package com.caikun.shopping_car_serve.mapper;


import com.caikun.model.entity.ServiceEntity;
import com.caikun.model.entity.ShoppingCar;
import com.caikun.model.vo.ShoppingCarRecord;
import com.caikun.model.vo.ShoppingCarVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Result;

import java.util.List;

@Mapper
public interface ShoppingCarMapper {

    // 查询有无存在的userId-packageId/serviceId
    ShoppingCar queryByUserIdAndServiceTypeAndpackageId(Integer userId, Integer serviceType, Integer packageId);

    //添加记录
    int insert (ShoppingCar shoppingCar);

    int delete (ShoppingCar shoppingCar);
    //删除记录 根据userId
    int deleteByuserId(Integer userId);

    List<ShoppingCarRecord> getshoppingCar(Integer userId);


    /**
     * 自增
     * @param userId 用户id
     * @param serviceType 服务类型 0 单项 1 套餐
     * @param packageId 服务id
     * @return
     */
    int updateAdd(Integer userId, Integer serviceType, Integer packageId);
    /**
     * 自减
     * @param userId 用户id
     * @param serviceType 服务类型 0 单项 1 套餐
     * @param packageId 服务id
     * @return
     */
    int updateDelete(Integer userId, Integer serviceType, Integer packageId);


}